package charts.elements; 

import flash.display.Sprite;
import charts.series.bars.ElementBase;

//	class PointBarFade extends Base {
class PointBarFade extends Sprite {
	
	public function new( index:Float, value:Dynamic, colour:Float, group:Float )
	{
		super(index,value,colour,'',0.6,group); // TODO - create the fields for this, look at Base
	}
	
	//public override function resize( sc:ScreenCoordsBase ):Void {
	public function resize( sc:ScreenCoordsBase ):Void {
		/*
		var tmp:Object = sc.get_bar_coords(this._x,this.group);
		this.screen_x = tmp.x;
		this.screen_y = sc.get_y_from_val(this._y,axis==2);
		
		var bar_bottom:Number = sc.getYbottom( false );
		
		var top:Number;
		var height:Number;
		
		if( bar_bottom < this.screen_y ) {
			top = bar_bottom;
			height = this.screen_y-bar_bottom;
		}
		else
		{
			top = this.screen_y
			height = bar_bottom-this.screen_y;
		}
		*/
		var h:Dynamic = this.resize_helper( cast( sc, ScreenCoords) );
		
		this.graphics.clear();
		this.graphics.beginFill( this.colour, 1.0 );
		this.graphics.moveTo( 0, 0 );
		this.graphics.lineTo( h.width, 0 );
		this.graphics.lineTo( h.width, h.height );
		this.graphics.lineTo( 0, h.height );
		this.graphics.lineTo( 0, 0 );
		this.graphics.endFill();
	}
}
